package com.bluetooth.phone;

import androidx.databinding.ObservableBoolean;
import androidx.databinding.ObservableInt;
import androidx.lifecycle.ViewModel;

public class MainViewModel extends ViewModel {

    private final ObservableInt mFrontFanLevelMax = new ObservableInt(8);
    private final ObservableInt mCurrentFrontFanLevel = new ObservableInt(3);
    private final ObservableBoolean mIsFrontFanAuto = new ObservableBoolean(false);
    private final ObservableBoolean mHvaEnable = new ObservableBoolean(false);
    private final ObservableInt mAutoFanSupport = new ObservableInt(3);

    public ObservableInt getFrontFanLevelMax() {
        return mFrontFanLevelMax;
    }

    public ObservableInt getCurrentFrontFanLevel() {
        return mCurrentFrontFanLevel;
    }

    public ObservableBoolean getIsFrontFanAuto() {
        return mIsFrontFanAuto;
    }

    public ObservableBoolean getHvaEnable() {
        return mHvaEnable;
    }

    public ObservableInt getAutoFanSupport() {
        return mAutoFanSupport;
    }

    private FanLevel.OnFanLevelInputChanged mFrontFanLevelChangeListener  = new FanLevel.OnFanLevelInputChanged() {
        @Override
        public void onChanged(int level) {
            mCurrentFrontFanLevel.set(level);
        }
    };

    public FanLevel.OnFanLevelInputChanged getFrontFanLevelChangeListener() {
        return mFrontFanLevelChangeListener;
    }

    public void setFrontFanLevelChangeListener(FanLevel.OnFanLevelInputChanged mFrontFanLevelChangeListener) {
        this.mFrontFanLevelChangeListener = mFrontFanLevelChangeListener;
    }

    public boolean isFunctionActive(int state){
        return state==0;
    }
}
